﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WFASmartketing.REPORTES
{
    public partial class ReporteComprasCreditoPagoWF : Form
    {
        public ReporteComprasCreditoPagoWF()
        {
            InitializeComponent();
            //cbxproveedor.Items.Add("TODOS");
            comboBox1.SelectedIndex = 0;
        }

        private void ReporteComprasCreditoPagoWF_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'proveedorDSReportes.proveedor' table. You can move, or remove it, as needed.
            this.proveedorTableAdapter.Fill(this.proveedorDSReportes.proveedor);
            // TODO: This line of code loads data into the 'proveedorDS.proveedor_selectAll' table. You can move, or remove it, as needed.
            this.proveedor_selectAllTableAdapter.Fill(this.proveedorDS.proveedor_selectAll);
            // TODO: This line of code loads data into the 'ReporteComprasCreditoPagoDS.ReporteComprasCreeditoconPagos' table. You can move, or remove it, as needed.
           RecaqrgarReporte();
        }

        private void reportViewer1_Load(object sender, EventArgs e)
        {
           
        }

        private void button1_Click(object sender, EventArgs e)
        {
          
        }
        private void RecaqrgarReporte() {
            string nrocompra = "%" + textBox1.Text + "%";
            string estadocompra = "";
            string proveedor = cbxproveedor.SelectedValue.ToString();
            if (comboBox1.SelectedItem.ToString().Equals("TODOS"))
            {
                estadocompra = "%%";
            }
            else { estadocompra = comboBox1.SelectedItem.ToString(); }
            this.ReporteComprasCreeditoconPagosTableAdapter.Fill(this.ReporteComprasCreditoPagoDS.ReporteComprasCreeditoconPagos, nrocompra, estadocompra, proveedor);
            this.reportViewer1.RefreshReport();
        }


       // private void reportViewer1_Load(object sender, EventArgs e)
       // {

      //  }

        private void button2_Click(object sender, EventArgs e)
        {
            RecaqrgarReporte();
        }

    }
}
